//
//  HomeNotificationCell.m
//  Rail
//
//  Created by hychen on 2018/3/1.
//  Copyright © 2018年 Hychen. All rights reserved.
//

#import "HomeNotificationCell.h"

@interface HomeNotificationCell ()
@property (weak, nonatomic) IBOutlet UIImageView *iconView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UIImageView *signView;
@end
@implementation HomeNotificationCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setModel:(NoticeModel *)model {
    _model = model;
    _warnModel = nil;
    self.titleLabel.text = model.title;
    self.contentLabel.text = model.content;
    self.timeLabel.text = [BMUtils chineseMMDDHHmmWithServiceTime:model.publish_time];
    
    self.signView.hidden = YES;
    
}

- (void)setWarnModel:(WarnModel *)warnModel {
    _warnModel = warnModel;
    _model = nil;
    self.titleLabel.text = [WarnLevelConfig alertTypeStringWithType:warnModel.alert_type]?:@"";
    self.contentLabel.text = warnModel.content;
    self.timeLabel.text = [BMUtils chineseMMDDHHmmWithServiceTime:warnModel.start_time];
    self.signView.hidden = NO;
}
@end
